<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminModulesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_modules', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('模块儿描述');
            $table->string('module')->comment('模块儿目录');
            $table->string('domain')->nullable()->comment('模块儿绑定的域名');
            $table->string('config')->comment('模块儿配置文件中的信息');
            $table->mediumText('permission')->comment('模块儿对应permission文件中权限信息');
            $table->text('admin_menu')->nullable()->comment('存放后台管理菜单');
//            注意,下面使用nullable的时候一定要加括号,表示调用这个nullable()方法,这样最后会返回一个对象
            $table->text('center_menu')->nullable()->comment('存放会员中心的菜单');
            $table->tinyInteger('center_menu_setting')->default(1)->comment('控制会员中心菜单是否显示');
            $table->text('space_menu')->nullable()->comment('存放个人空间的菜单');
            $table->tinyInteger('space_menu_setting')->default(0)->comment('控制个人空间的菜单是否显示');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_modules');
    }
}
